package com.qianfeng.yime.model;

/**
 * Created by Fcy on 2015/3/11.
 */

import com.qianfeng.yime.Constants;
import com.qianfeng.yime.R;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * 热门职业
 */

public class HotJob {
    private String corpLogo;   //"/upload/logo/20150110130001_177scale.jpg"
    private String corpName;   //"深圳市永源丰实业发展有限公司"

    private int id; //76025 // 对应详情请求中的jobid
    private int jobsettletypeId;    //1 结算类型 按日

    private int jobtypeId;  //7 其他

    private String name;    //"诚招面膜兼职微代理、助理"
    private int pay;    // 50

    private int payUnit;    //4 元/件

    public void parsJson(JSONObject json) {
        try {
            corpLogo = Constants.API_POINT_URL + json.getString("corpLogo");
            corpName = json.getString("corpName");
            id = json.getInt("id");
            jobsettletypeId = json.getInt("jobsettletypeId");
            jobtypeId = json.getInt("jobtypeId");
            name = json.getString("name");
            pay = json.getInt("pay");
            payUnit = json.getInt("payUnit");
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    /**
     * 重写HotJob的equals方法，根据id是否相等，判断是否是同一对象
     *
     * @param o
     * @return
     */
    @Override
    public boolean equals(Object o) {
        HotJob job = (HotJob) o;
        if (job.id == this.id) { // 同一个
            return true;
        }
        return false;
    }

    public String getCorpLogo() {
        return corpLogo;
    }

    public void setCorpLogo(String corpLogo) {
        this.corpLogo = corpLogo;
    }

    public String getCorpName() {
        return corpName;
    }

    public void setCorpName(String corpName) {
        this.corpName = corpName;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getJobsettletypeId() {
        return jobsettletypeId;
    }

    public void setJobsettletypeId(int jobsettletypeId) {
        this.jobsettletypeId = jobsettletypeId;
    }

    public int getJobtypeId() {
        return jobtypeId;
    }

    public void setJobtypeId(int jobtypeId) {
        this.jobtypeId = jobtypeId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getPay() {
        return pay;
    }

    public void setPay(int pay) {
        this.pay = pay;
    }

    public int getPayUnit() {
        return payUnit;
    }

    public void setPayUnit(int payUnit) {
        this.payUnit = payUnit;
    }
}
